import {view, binder, ViewGroup} from "adajs";
import CourseService from "./state.js";
import List from "./../../lists";

@view({
    className: "organizelist",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: CourseService
    }
})
class CourseList extends ViewGroup {
    tags() {
        return {list: List};
    }

    @binder("openNews")
    openNews({item}) {
        this.dispatchEvent("gotoPage", `/common/news/detail?id=${item.id}`);
    }

    @binder("open")
    open({item}) {
        this.commit("open", item);
    }
}

export default CourseList;